import request from "@/utils/request";

// 查询我的翻译版本
export function myListTranslate(query) {
  return request({
    url: "/business/Translate/myList",
    method: "get",
    params: query,
  });
}


// 查询翻译详细
export function getTranslate(translateId) {
  return request({
    url: "/business/Translate/" + translateId,
    method: "get",
  });
}



// 修改翻译
export function updateTranslate(data) {
  return request({
    url: "/business/Translate",
    method: "put",
    data,
  });
}

// 删除翻译
export function delTranslate(translateId) {
  return request({
    url: "/business/Translate/" + translateId,
    method: "delete",
  });
}



// 保存翻译版本
export function saveTranslationVersionApi(data) {
  return request({
    url: "/business/Translate/saveTranslationVersion",
    method: "post",
    data,
  });
}


/**
 * 获取顶级翻译版本
 * @param params
 * @returns {*}
 */
export function topVersionListApi(params) {
  return request({
    url: "/business/Translate/topVersionList",
    params
  });
}


/**
 * 单条翻译值
 * @param data
 * @returns {*}
 */
export function translateApi(data) {
  return request({
    url: "/business/Translate/t",
    method: "post",
    data,
  });
}


// 新增翻译
export function addTranslate(data) {
  return request({
    url: "/business/Translate",
    method: "post",
    data,
  });
}

/**
 * 翻译
 * @param data
 * @returns {*}
 */
export function youdaoTranslate(data) {
  return request({
    url: "/business/Translate/translation",
    method: "post",
    data,
  });
}
